/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2025 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32g4xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "ff.h"
/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
  typedef struct fifo_Handle {
    uint8_t deta[128];
    RTC_DateTypeDef Data;  //?????
    RTC_TimeTypeDef Time;   //?????
    uint32_t tick;
  } fifo_Handle;
/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */
  extern uint8_t mood;
/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */
  uint8_t fileSystemInit(void);
  void mount_disk(void);
/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define LED1_Pin GPIO_PIN_13
#define LED1_GPIO_Port GPIOC
#define key3_Pin GPIO_PIN_0
#define key3_GPIO_Port GPIOA
#define key4_Pin GPIO_PIN_1
#define key4_GPIO_Port GPIOA
#define SPIFLASH_CS_Pin GPIO_PIN_4
#define SPIFLASH_CS_GPIO_Port GPIOA
#define OLED_DC_Pin GPIO_PIN_10
#define OLED_DC_GPIO_Port GPIOC
#define OLED_RES_Pin GPIO_PIN_11
#define OLED_RES_GPIO_Port GPIOC
#define OLED_NSS_Pin GPIO_PIN_4
#define OLED_NSS_GPIO_Port GPIOB
#define key1_Pin GPIO_PIN_8
#define key1_GPIO_Port GPIOB
#define LED2_Pin GPIO_PIN_9
#define LED2_GPIO_Port GPIOB

/* USER CODE BEGIN Private defines */
#define LED1_ON()   HAL_GPIO_WritePin(LED1_GPIO_Port,LED1_Pin,RESET);
#define LED1_OFF()  HAL_GPIO_WritePin(LED1_GPIO_Port,LED1_Pin,SET);
#define LED2_ON()   HAL_GPIO_WritePin(LED2_GPIO_Port,LED2_Pin,RESET);
#define LED2_OFF()  HAL_GPIO_WritePin(LED2_GPIO_Port,LED2_Pin,SET);
/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
